localIP=$(ifconfig | grep 'inet addr:' | grep -v '127.0.0.1' | tail -1 | cut -d: -f2 | awk '{ print $1}') # 局域网IP

publicIP=$(hostname -i) # 公网IP

IP=$(ifconfig $(route -n | grep ^0.0.0.0 | awk '{print $NF}') | grep inet | grep -v inet6 | awk '{print $2}')
PS1="%B%F{yellow} ➜ %F{9}%n@$IP %F{50}%~ %F{13}%B%# %f%b"

# 配置命令模糊匹配:
zstyle ':completion:*' matcher-list '' \
    'm:{a-z\-}={A-Z\_}' \
    'r:[^[:alpha:]]||[[:alpha:]]=** r:|=* m:{a-z\-}={A-Z\_}' \
    'r:|?=** m:{a-z\-}={A-Z\_}'
autoload -Uz compinit && compinit

# 配置忽略大小写匹配:
zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|=*' 'l:|=* r:|=*'
autoload -Uz compinit && compinit

# 为历史纪录中的命令添加时间戳:
setopt EXTENDED_HISTORY

# 启用自动 cd，输入目录名回车进入目录
# 稍微有点混乱，不如 cd 补全实用
setopt AUTO_CD
